let fun={
    queryPetList:(pageNum)=>{
        let name=document.getElementById("name").value;
        fetch(window.server_path+window.server_post.queryPetList,{
            method:"POST",
            headers:{"Content-Type":"application/json"},
            body:JSON.stringify({
                data:JSON.stringify({
                    phone:window.sessionStorage.getItem("phone"),
                    command:window.localStorage.getItem("command"),
                    nowPageNum:pageNum,
                    name:name
                })
            })
        }).then(re=>{return re.json()}).then(da=>{
            if(!da.status)return;
            let das=[];
            for(let i in da.data){
                let img=document.createElement("img");
                img.src=window.resource_path.pet+da.data[i].pid+".png";
                let lock=document.createElement("button");
                lock.innerHTML="禁用";
                let r=[da.data[i].pid,da.data[i].name,img,da.data[i].attack,da.data[i].defence,da.data[i].blood,lock];
                das.push(r);
            }
            ftable.setData("table",das);
            ftable.setPages("tfoot",da.allPageNum,da.nowPageNum,fun.queryPetList);
        })
    }
}
fun.queryPetList(1);